Get the localisation of the station
station <- read_delim("../edeline_work/Donnes_Onema/Stations_EricE_WSG84.csv",
delim = ";", locale = locale("fr", decimal_mark = "."),
col_types = cols(ST_CODECSP = col_character()))
# Modif ID in integer
xy_station <- dplyr::select(station, XCOORD, YCOORD)
station <- SpatialPointsDataFrame(coords = xy_station, data = station,
proj4string = CRS("+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0"))
station <- st_as_sf(station)##Â Get France map
region_fr <- raster::shapefile("../data-raw/france_region_shp/regions-20180101.shp")
#Get only metropolitan areas:
region_fr <- st_as_sf(region_fr) #easier to manipulate
region_to_filter <- c("La Réunion", "Martinique", "Guadeloupe", "Mayotte",
"Guyane", "Corse")
region_fr <- filter(region_fr, !(nom %in% region_to_filter))
region_fr <- region_fr[, c("nom", "geometry")]plot(st_geometry(region_fr), lwd = 1.5, col = "grey85")
plot(station, pch = 20, col = "red", add = T)
#> Warning in plot.sf(station, pch = 20, col = "red", add = T): ignoring all
#> but the first attribute